//
//  DiseaseTypeFlowLayout.m
//  QuickCure1
//
//  Created by Ashzenki on 01/11/2016.
//  Copyright © 2016 maoge. All rights reserved.
//

#import "DiseaseTypeFlowLayout.h"

@implementation DiseaseTypeFlowLayout

- (void)prepareLayout {
    [super prepareLayout];
    
    int cols = 3;
    int rows = 2;
    
    CGFloat itemH = self.collectionView.height / rows - 2;
    CGFloat itemW = self.collectionView.width / cols;
    
    self.itemSize = CGSizeMake(itemW, itemH);
    
    //设置每个item的间距
    self.sectionInset = UIEdgeInsetsMake(0.5, 0.5, 0.5, 0.5);
    
    self.minimumInteritemSpacing = 1;
    self.minimumLineSpacing = 1;
    
    self.scrollDirection = UICollectionViewScrollDirectionHorizontal;
}

@end
